{% load i18n %}
{% load account_tags %}

<div class="pull-right">
    {% if request.user.is_authenticated %}
        <p class="navbar-text pull-left">{% trans "Logged in as:" %}</p>
    {% endif %}
    <ul class="nav pull-right">
        {% if request.user.is_authenticated %}
            <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                    {% user_display request.user %}
                    <b class="caret"></b>
                </a>
                <ul class="dropdown-menu">
                    <li><a href="{% url account_settings %}"><i class="icon-user"></i> {% trans "Settings" %}</a></li>
                    {% if request.user.is_staff %}
                        <li><a href="{% url admin:index %}"><i class="icon-cog"></i> {% trans "Admin" %}</a></li>
                    {% endif %}
                    <li class="divider"></li>
                    <li><a href="{% url account_logout %}"><i class="icon-off"></i> {% trans "Log out" %}</a></li>
                </ul>
            </li>
        {% else %}
            <li><a href="{% url account_login %}">{% trans "Log in" %}</a></li>
            {% if ACCOUNT_OPEN_SIGNUP %}
                <li class="navbar-text">{% trans "or" %}</li>
                <li><a href="{% url account_signup %}">{% trans "Sign up" %}</a></li>
            {% endif %}
        {% endif %}
    </ul>
</div>
